<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>餐厅信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
            $('#inputForm').bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {
						
					name: {
                            message: '餐厅名称格式错误',
                            validators: {
                                notEmpty: {
                                    message: '餐厅名称不能为空'
                                }
                            }
                        }
						,
					address: {
                            message: 'address格式错误',
                            validators: {
                                notEmpty: {
                                    message: 'address不能为空'
                                }
                            }
                        }
						,
					tel: {
                            message: 'tel格式错误',
                            validators: {
                                notEmpty: {
                                    message: 'tel不能为空'
                                }
                            }
                        }
						,
					serviceTariffing: {
                            message: 'serviceTariffing格式错误',
                            validators: {
                                notEmpty: {
                                    message: 'serviceTariffing不能为空'
                                }
                            }
                        }
						,
					fastFoodFlag: {
                            message: 'fastFoodFlag格式错误',
                            validators: {
                                notEmpty: {
                                    message: 'fastFoodFlag不能为空'
                                }
                            }
                        }
                }
            })
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs nav-tabss">
		<li><a href="${ctx}/restaurant/restaurant/">餐厅信息列表</a></li>
		<li class="active"><a href="${ctx}/restaurant/restaurant/form?id=${restaurant.id}">餐厅信息<shiro:hasPermission name="restaurant:restaurant:edit">${not empty restaurant.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="restaurant:restaurant:edit">查看</shiro:lacksPermission></a></li>
	</ul>
	<div class="ibox-content">
		<form:form id="inputForm" modelAttribute="restaurant" action="${ctx}/restaurant/restaurant/save" method="post" class="form-horizontal">
			<tags:message content="${message}"/>
			<form:hidden path="id"/>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="name">餐厅名称:</label>
                    <div class="col-sm-4">
                        <form:input path="name" htmlEscape="false" class="required form-control"/>
                        <span class="help-inline"><font color="red">*</font> </span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="address">地址:</label>
                    <div class="col-sm-4">
                        <form:input path="address" htmlEscape="false" class="required form-control"/>
                        <span class="help-inline"><font color="red">*</font> </span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="tel">联系电话:</label>
                    <div class="col-sm-4">
                        <form:input path="tel" htmlEscape="false" class="required form-control"/>
                        <span class="help-inline"><font color="red">*</font> </span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="serviceTariffing">服务费率:</label>
                    <div class="col-sm-4">
                        <form:input path="serviceTariffing" htmlEscape="false" class="required form-control"/>
                        <span class="help-inline"><font color="red">*</font> </span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="fastFoodFlag">是否快餐:</label>
                    <div class="col-sm-4">
                        <form:select path="fastFoodFlag" htmlEscape="false" cssClass="form-control">
				            <form:option value="0" label="0-非快餐"/>
				            <form:option value="1" label="1-快餐"/>
			            </form:select>
                        <span class="help-inline"><font color="red">*</font> </span>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                
			<div class="form-group">
				<label class="col-sm-2 control-label"></label>
				<div class="col-sm-4">
					<shiro:hasPermission name="restaurant:restaurant:edit">
						<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
					</shiro:hasPermission>
					<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
				</div>
			</div>
		</form:form>
	</div>
</body>
</html>
